|
ARD2
1.00 for Rev B. Hardware
Airbag Reference Demonstrator using MPC5604P
|
00001 /****************************************************************************** 00002 * 00003 * Freescale Semiconductor Inc. 00004 * (c) Copyright 2004-2010 Freescale Semiconductor 00005 * ALL RIGHTS RESERVED. 00006 * 00007 ****************************************************************************/ 00019 #ifndef __FREEMASTER_REC_H 00020 #define __FREEMASTER_REC_H 00021 00022 #ifndef __FREEMASTER_H 00023 #error Please include freemaster_rec.h after freemaster.h main header file. 00024 #endif 00025 00026 #include "freemaster.h" 00027 #include "freemaster_private.h" 00028 00029 /*********************************** 00030 * global recorder types 00031 ***********************************/ 00032 00033 /* recorder runtime flags */ 00034 typedef volatile union 00035 { 00036 FMSTR_FLAGS all; 00037 00038 struct 00039 { 00040 unsigned bIsConfigured : 1; /* recorder is configured */ 00041 unsigned bIsRunning : 1; /* recorder is running */ 00042 unsigned bIsStopping : 1; /* trigger activated, sample countdown */ 00043 unsigned bInvirginCycle : 1; /* virgin cycle of the circular buffer in-progress */ 00044 unsigned bTrgCrossActive : 1; /* trigger threshold was crossed */ 00045 } flg; 00046 00047 } FMSTR_REC_FLAGS; 00048 00049 /* the same flags for optimized asm access (see fast recorder) */ 00050 #if defined(FMSTR_PLATFORM_56F8xxx) /* flag allocation tested on 56f8xxx only */ 00051 #define FMSTR_REC_FLAG_bIsConfigured 0x01 00052 #define FMSTR_REC_FLAG_bIsRunning 0x02 00053 #define FMSTR_REC_FLAG_bIsStopping 0x04 00054 #define FMSTR_REC_FLAG_bInvirginCycle 0x08 00055 #define FMSTR_REC_FLAG_bTrgCrossActive 0x10 00056 #endif 00057 00058 #define FMSTR_REC_FLOAT_TRIG_MASK 0x02 00059 00060 /*********************************** 00061 * global recorder variables 00062 ***********************************/ 00063 00064 /* configuration variables */ 00065 extern FMSTR_U16 pcm_wRecTotalSmps; /* number of samples to measure */ 00066 extern FMSTR_U16 pcm_wRecPostTrigger; /* number of post-trigger samples to keep */ 00067 extern FMSTR_U8 pcm_nRecTriggerMode; /* trigger mode (0 = disabled, 1 = _/, 2 = \_) */ 00068 extern FMSTR_U16 pcm_wRecTimeDiv; /* divisor of recorder "clock" */ 00069 00070 extern FMSTR_U8 pcm_nRecVarCount; /* number of active recorder variables */ 00071 extern FMSTR_ADDR pcm_pRecVarAddr[FMSTR_MAX_SCOPE_VARS]; /* addresses of recorded variables */ 00072 extern FMSTR_SIZE8 pcm_pRecVarSize[FMSTR_MAX_SCOPE_VARS]; /* sizes of recorded variables */ 00073 00074 /* runtime variables */ 00075 extern FMSTR_U16 pcm_wRecBuffStartIx; /* first sample index */ 00076 00077 extern FMSTR_ADDR pcm_dwRecWritePtr; /* write pointer in recorder buffer */ 00078 extern FMSTR_ADDR pcm_dwRecEndBuffPtr; /* pointer to end of active recorder buffer */ 00079 extern FMSTR_U16 pcm_wRecTimeDivCtr; /* recorder "clock" divisor counter */ 00080 extern FMSTR_U16 pcm_wStoprecCountDown; /* post-trigger countdown counter */ 00081 00082 extern FMSTR_REC_FLAGS pcm_wRecFlags; 00083 00084 00085 #endif /* __FREEMASTER_REC_H */